Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Wiki: DID Resolution #823

Merged
merged 20 commits into from
May 6, 2022
Merged

Update Wiki: DID Resolution #823

merged 20 commits into from
May 6, 2022

Conversation

olivereanderson
Copy link
Contributor

@olivereanderson olivereanderson commented Apr 27, 2022

Description of change

Updates the content of the resolve section of the wiki.

Links to any relevant issues

Fixes issue #824

Type of change

Add an x to the boxes that are relevant to your changes.

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Fix

Open Questions

  • The code snippet explaining how to resolve a DID from a private tangle assumes that a client has already been configured to use said network (with a link to an example where this is done). Is that OK? Note that writing a complete example would imply a lot of code duplication with the private_tangle example.
  • The code snippet explaining how to resolve the history of a DID Document assumes that the DID of interest has already been initialized and has a non trivial history. Is that OK? Note that including the setup of a DID Document and manipulating it in the example would imply a lot of code duplication with the account/manipulate_didexample.
  • The easy doc initialization idiom is applied in the two aforementioned code snippets. Is this fine, or would it be better to do something like let did: IotaDID = ...; to indicate that
    how the did is created is not of direct relevance to this example?
  • Can the wiki page resolve_history.mdx be deleted now?

Change checklist

Add an x to the boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@olivereanderson olivereanderson changed the base branch from dev to support/v0.5 April 27, 2022 15:53
@olivereanderson olivereanderson changed the title Doc/resolver WIP: Doc/resolver Apr 27, 2022
@olivereanderson olivereanderson added Chore Tedious, typically non-functional change Documentation Improvements or additions to documentation. Excludes from changelog labels Apr 27, 2022
@olivereanderson olivereanderson self-assigned this Apr 27, 2022
@olivereanderson olivereanderson marked this pull request as ready for review April 28, 2022 11:25
@olivereanderson olivereanderson changed the title WIP: Doc/resolver Doc/resolve Apr 28, 2022
Copy link
Collaborator

@JelleMillenaar JelleMillenaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! I think you covered as much of the topic as can be expected. Clear and too the point :) I would like to still have the embedded example and other comment covered, but shouldn't take too long ;)


<CodeSnippet
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the example. You can move it to the bottom if you don't want to refer to it at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That example uses the now deprecated spec compliant resolution API hence I think it is better if we no longer link to it in our v0.5 documentation. I have included code snippets explaining how to resolve using the new Resolver. Is that OK?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH no, in that case please update the example to use the new resolution API ;D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but that example should probably be a separate PR. I will attend to it now 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better now?

documentation/docs/decentralized_identifiers/resolve.mdx Outdated Show resolved Hide resolved
documentation/docs/decentralized_identifiers/resolve.mdx Outdated Show resolved Hide resolved
documentation/docs/decentralized_identifiers/resolve.mdx Outdated Show resolved Hide resolved
@olivereanderson olivereanderson merged commit d23ab66 into support/v0.5 May 6, 2022
@olivereanderson olivereanderson deleted the doc/resolver branch May 6, 2022 11:34
@olivereanderson olivereanderson changed the title Doc/resolve Update Wiki: DID Resolution May 6, 2022
eike-hass pushed a commit that referenced this pull request May 6, 2022
eike-hass added a commit that referenced this pull request May 6, 2022
eike-hass pushed a commit that referenced this pull request May 13, 2022
HenriqueNogara pushed a commit that referenced this pull request Jun 6, 2022
* add key_exchange, encrypt_data, decrypt_data to storage and account

* add bindings and rust example

* add bindings example

* Add key_exchange, encrypt_data, decrypt_data to memstore, change encrypt/decrypt data signature

* Add nonce to EncryptedData

* Add associated data into EncryptedData

* remove key_exchange from storage, remove encryption_key type, add algorithm encryption, move key_exchange to encrypt/decrypt functions

* remove unnecessary into

* Generate random shared secret location

* Remove generic crypto error

* Add crypto::error::Error as source for new errors

* Add encryption option - with cek enum

* Add EncryptionOptions to bindings and to memstore

* Make PublicKey mandatory in the storage trait, return an error when using a ED25519 key for encryption/decryption

* Doc/resolve (#823)

* Upgrade to new `Stronghold` interface (#787)

* Rename stronghold module

* Postfix old stronghold with `_old`

* Migrate to new stronghold interface

* Impl did_create properly with client syncing

* Add context to `StrongholdError`s

* Add `Stronghold` wrapper test

* Add `test_key_delete`

* Add storage_test_suite setup & did_create test

* Re-export test suite feature

* Expose test suite in Wasm

* Extend `did_create` test, fix index persistence

* Test `key_generate`

* Move `key_delete` to test suite

* Remove test suite from this branch

* Add initial test suite and expose to Wasm

* rm `Error` postfix from `StrongholdError` variants

* Remove duplicate `mod tests` in Wasm

* Handle client sync error; document syncing

* Use updated stronghold

* Use dedicated `load_snapshot` function

* Purge client in `did_purge`

* Revert cfg_attr shenanigans

* Make `Stronghold::client` not async

* Remove asyncness from fns where not necessary

* Make `mutate_client` not async either

* Move test_util mod where it belongs

* Remove `source` errors from `Display` impl

* Remove `RecordHint` everywhere

* Use base crate `MemoryError`; remove engine dep

* Revert temporary send/sync change

* Document `Stronghold` wrapper

* Use same export style as other crates

* Create parent directories if they don't exist

* Remove outdated TODO

* Fix index writing in purge; update stronghold rev

* Remove old stronghold wrapper

* Reactivate multi identity example

* Add `dropsave` getter/setter

* Fully qualify `std::any::type_name`

* Remove tests which are already in test suite

* Reactivate `Send`-assertion test

* Return `Stronghold` instance from test `storages`

* Test incorrect password returns error

* Use `OsRng` instead of `thread_rng`

* Bump stronghold revision

* Remove unused `getrandom` depenency

* Remove unused `actix` dependency

* Remove tokio `rt-multi-thread` feature

* Prefer `sample_string` over `sample_iter`

* Enable `didPurge` test for NAPI stronghold

* Simplify `did_create` by using `mutate_client`

* Rename doc/state client paths to store keys

* Add procedure_error fn to reduce err map code

* Remove unnecessary clone

* Disable multiple identities example temporarily

* Disable musl build

* Remove musl target from stronghold-nodejs

* use local workflow file

* Revert "use local workflow file"

This reverts commit 2f12afd.

Co-authored-by: Eike Haß <eike-hass@web.de>

* add concat_kdf procedure

* add concat kdf for memstore

* rename Cekalgorithm struct; remove error variant; add constructor to bindings new function

* Improve error msg; Add feature to cargo toml; Replace client for resolver

* Add ephemeral key for ECDH-ES

* Add test for stronghold encryption; Fix rust example; Add feature for account encryption; Improve docs

* Sync comments for traits, account, and wasm

* Improve docs; Fix Memstore cocat kdf; Remove EncryptionOptions

* Add test for storage test suite; Fix padding in Memstore

* Rename outdated file

* Add exception for encryption methods in MemStore

* Fix naming in javascript; Switch back to ThreadRng

* Remove useless variable

* Improve docs; Make EncryptedData fields pub

* Fix readme

* Undo removal of files

* Fix function call

Co-authored-by: Eike Haß <eike-hass@web.de>
Co-authored-by: Oliver E. Anderson <oliver.anderson@iota.org>
Co-authored-by: Philipp <philipp.gackstatter@iota.org>
PhilippGackstatter added a commit that referenced this pull request Jun 23, 2022
* actor: Add builder for `Communicator`

* identity: Re-export actor types

* actor: Specify `tokio` dep explicitly via git

* actor: Specify `tokio` via crates.io

* actor: Rename communicator module to actor

* actor: Rename communicator structs to actor

* actor: Rename `register_command` to `set_handler`

* actor: Spawn handler loop internally

* actor: Impl dispatch pattern for handler loop

* actor: Trait to determine `send_request` ret type

* actor: Get request_name based on type parameter

* actor: Remove `Identity` prefixes in type names

* actor: Finer-grained handler impl for a nicer API

* actor: Migrate to new stronghold comms version

* actor: Fix account feature conditional guards

* actor: Use type map to allow reusing receiver

* actor: Update stronghold comms to new version

* actor: Impl async handler functions

* actor: Separate storage handler & types

* actor: Rename StorageHandler & impl resolution

* actor: Reexport Keypair

* actor: Expand Cargo package info

* actor: Only spawn listener if there are addresses

* actor: Upgrade stronghold comms lib version

* actor: Add dummy comm handler

* actor: Expose executor builder API

* actor: Impl ffi-compatible handler registration

* actor: Use closures instead of function pointers

Signed-off-by: PhilippGackstatter <philipp.gackstatter@iota.org>

* actor: Let request_name take &self for bindings

* actor: Use `Cow` in trait for more flexibility

* actor: Use `log` instead of println

* actor: Implement `send_named_request` for bindings

* actor: Use `ClientMap` for working did resolution

* actor: Upgrade to latest stronghold p2p

* actor: Impl remote error and deserialization logic

* actor: Restructure tests, add SendError test

* actor: Use new `StorageError`

* actor: Handle all errors in handle invoker task

* actor: Define separate request & response types

* actor: Expand `StorageError` & impl `Category`

* Add licences to all files

* Apply cargo and toml formatting

* Address clippy lints

* Define a type name for the more complex types

* Update to latest stronghold p2p version

* Let `add_method` take an `async fn` directly

* Use consistent names for the generics

* Implement `Endpoint` and catch-all handler

* Make `Actor` cloneable, inject it into handlers

* Inject `PeerId` into every handler

* Impl `RequestContext<T>` & dummy didcomm protocol

* Add test for other presentation direction

* Rename handler registration methods

* Refactor handler invocation in prep for hooks

* Implement basic `call_hook` method

* Update account usages to latest dev

* Remove memory leak / circular reference

* Impl part of a hook test

* Fully impl hook invocation in send_request

* Apply new rustfmt granularity

* Restructure actor crate

* Restructure didcomm parts

* Add error handling in `RequestHandler::invoke`

* Fix response serialization

* Impl hooks for `await_message`

* Add await_message hook error test

* Migrate to latest dev

* Reduce code duplication for handler invocation

* Replace `stronghold-p2p` with only `libp2p`

* Impl working serialization; add invocation test

* Return `RemoteSendError` in `Actor::send_request`

* Partially implement didcomm threads

* Impl thread routing

* Reimplement implicit hooks

* Add `StopListening` command

* Refactor handler invocation fns

* Address clippy lints

* Shrink actor state to make cloning cheaper

* Improve type safety of `HandlerBuilder`

* Store `peer_id` in `ActorState`

* Remove one superfluous tokio task and channel pair

* Map errors and document `ActorBuilder`

* Polish errors

* Update copyright to 2022

* Replace `DidCommRequest` with `RequestMessage`

* Move message types to p2p module

* Match more efficiently on swarm events

* Remove `SwarmCommand::GetPeerId`

* Return inbound failure when sending response

* Rename shutdown method

* Remove send_request functions for now

* Reorganize crate

* Remove `DidCommActor`

* Factor out "default" `RequestHandler` impls

* Spell out individual exports

* Rename `AsyncFn` -> `Handler`

* Rename `DidCommHook` -> `Hook`

* Move `ActorRequest` to its own module

* Reogranize dependencies

* Better test name

* Implement `RequestMode`, partially

* Implement (a)sync `RequestMode` using strategies

* Make `InvocationStrategy` methods static

* Add `Actor::send_request`

* Do not send DCPM in sync mode

* Make `ActorRequest` generic over `SyncMode`

* Redo the serialization errors (partial)

* Finish serialization error refactoring

* Add timeout error

* Make downcasting & cloning objects fallible

* Introduce `HandlerObject` type for readability

* Restrict `Endpoint`s to ascii alphabetic and `_`

* Fix `Actor::start_listening`

* Drain open channels during shutdown

* Add `ActorConfig` and timeout

* Reorganize imports

* Be more specific for non-existent threads

* Fix logger in tests and listening

* Add actor feature in identity crate

* Impl working test remote account

* Test thread not found error for async messages

* Remove `RequestHandler::object_type_id` (unused)

* Inline `InvocationStrategy` methods

* Abort request handling on error in async strategy

* Impl `FromStr` for `Endpoint`

* Only allow handler modification during build phase

* Add remote account benchmark

* Document public types (partial)

* Remove unused errors; remove `Category`

* Document the rest

* Make p2p module exports explicit

* Make remote_account exports explicit

* Remove exports from remote_account

* Remove commented code in didcomm presentation

* Rm unnecessary bounds on `ActorRequest` generics

* Test various error scenarios

* Remove start_listening test b/c non-deterministic

* Add handler finishes after shutdown test

* Rename `ActorRequest::request_name` -> `endpoint`

* Reduce p2p module visibility

* Make `Actor::peer_id` just `&self`

* Impl `add_addresses` for improved test reliability

* Increase timeout to increase test reliability

* Specialize `add_handler` for synchronicity

* Fix documentation for `add_handler` functions

* Use minor version; use default-features = false

* Return `Error::Shutdown` instead of panicking

* Document more on the `Actor` type

* Move bounds onto `InvocationStrategy` trait

* Test subset of serialization errors

* Don't require absolute latest tokio version

* Bump `libp2p` to `0.43`

* Feature gate `ActorBuilder::build`

* Add Wasm integration features

* Remove superfluous `pub(crate)` in `mod p2p`

* Use fn pointers instead of generic closures

* Update comment in shutdown test

* Address import issues caused by merge

* Fix post-merge issues

* Let `ActorRequest::endpoint` return `&'static str`

* Remove explicit hook endpoint from `add_hook`

* Remove TODO on actor protocol version

* Factor out `DidComm` specifics into `DidCommActor`

* Split `ActorBuilder` into two

* Fix docs, remove superfluous functions

* Change how items are exported

* Refactor into `RawActor`

* Refactor actor state repr (partial)

* Split `RequestHandler` in two

* Return `Endpoint` from `ActorRequest::endpoint`

* Remove `RawActor`

* Split `ActorRequest` in two

* Fix `ActorRequest` docs

* Doc/resolve (#823)

* Upgrade to new `Stronghold` interface (#787)

* Rename stronghold module

* Postfix old stronghold with `_old`

* Migrate to new stronghold interface

* Impl did_create properly with client syncing

* Add context to `StrongholdError`s

* Add `Stronghold` wrapper test

* Add `test_key_delete`

* Add storage_test_suite setup & did_create test

* Re-export test suite feature

* Expose test suite in Wasm

* Extend `did_create` test, fix index persistence

* Test `key_generate`

* Move `key_delete` to test suite

* Remove test suite from this branch

* Add initial test suite and expose to Wasm

* rm `Error` postfix from `StrongholdError` variants

* Remove duplicate `mod tests` in Wasm

* Handle client sync error; document syncing

* Use updated stronghold

* Use dedicated `load_snapshot` function

* Purge client in `did_purge`

* Revert cfg_attr shenanigans

* Make `Stronghold::client` not async

* Remove asyncness from fns where not necessary

* Make `mutate_client` not async either

* Move test_util mod where it belongs

* Remove `source` errors from `Display` impl

* Remove `RecordHint` everywhere

* Use base crate `MemoryError`; remove engine dep

* Revert temporary send/sync change

* Document `Stronghold` wrapper

* Use same export style as other crates

* Create parent directories if they don't exist

* Remove outdated TODO

* Fix index writing in purge; update stronghold rev

* Remove old stronghold wrapper

* Reactivate multi identity example

* Add `dropsave` getter/setter

* Fully qualify `std::any::type_name`

* Remove tests which are already in test suite

* Reactivate `Send`-assertion test

* Return `Stronghold` instance from test `storages`

* Test incorrect password returns error

* Use `OsRng` instead of `thread_rng`

* Bump stronghold revision

* Remove unused `getrandom` depenency

* Remove unused `actix` dependency

* Remove tokio `rt-multi-thread` feature

* Prefer `sample_string` over `sample_iter`

* Enable `didPurge` test for NAPI stronghold

* Simplify `did_create` by using `mutate_client`

* Rename doc/state client paths to store keys

* Add procedure_error fn to reduce err map code

* Remove unnecessary clone

* Disable multiple identities example temporarily

* Disable musl build

* Remove musl target from stronghold-nodejs

* use local workflow file

* Revert "use local workflow file"

This reverts commit 2f12afd.

Co-authored-by: Eike Haß <eike-hass@web.de>

* Fix Stronghold bindings build for musl (#845)

* Use Alpine container to build Stronghold for musl

* Remove musl setup step

* Change musl container to rust:1.60-alpine

* Specify shell in CI

* Remove shell configuration

* Remove node check-latest

* Install NodeJs manually for musl

* Remove obsolete comment

* Point action back at dev branch

* Remove unused Dockerfile, switch to rust:1-alpine

* Revert `IdentitySetup` modifications

* Refactor `Endpoint`

* Let `Endpoint` deserialization validate

* Document outstanding methods and types

* Document and test `OneOrMany(Into)Iter(ator)`

* Remove unstable error types from public API

* Remove duplicate test assertion

* Test newer nightly in CI

* Refactor `Actor` to trait approach

* Document types

* Move poc modules behind test flag

* Remove hooks

* Rename modules

* Remove `primitives` feature flag

* Rename `actor` flag to `actor-unstable`

* Derive Debug for `System`

* Derive `Debug` for `DidCommSystem`

* More renaming actor to system

* Add missing `async` feature on `identity-iota`

* Remove `cfg-if` dep; use `tokio` unconditionally

* Bump `libp2p` to `0.45`

* Remove hooks from `Endpoint`s, simplify tests

* Log warning instead of panicking

* Improve log statements

* Document and rename `actor_not_found` method

* Remove unnecessary tests, document tests more

* Add a `yield_now` to allow bg tasks to finish

* Remove `listen_on` due to unreliability

* Reorg imports to std/crates/internal hierarchy

* Return error in base system on async requests

* Rename actor to system

* Remove unnecessary features and dependencies

* Improve `Endpoint` doc

* Remove `HookInvocationError`

* Rename `add_address` -> `add_peer_address`

* Document more, make more things private

* Forbid unsafe code, add warning lints

* Rename actor to agent

* Rename more types to agent, fix docs accordingly

* Add DIDComm benchmark

* Add required features to run tests

* Improve DIDComm test docs

* Rename `PeerId` -> `AgentId`

* Rename `ActorResult` -> `AgentResult`

* Rename mod `actor` to `agent`

* Rename `System` to `Agent`

* Rename `Actor` to `Handler`

* Revert unintended changes

* Use agent instead of actor in `identity_iota`

* Revert another unintended change

* Rename `ACT` generic type to `HND`

* Add keywords, remove wasm dependencies

* Bump dashmap to `5.3`

* Replace more occurences of peer with agent

* Use `DidCommRequest` terminology consistently

* Annotate types in `AgentBuilder`

* Change agent exports

* Use only required features

* Remove unused ITERATIONS param

* Fix docs and implicit agent feature

* Use `AgentId` instead of peer id terminology

* Improve `DidCommAgent` doc description

* Add README as crate description and in docs

* Ignore rust doctests

Co-authored-by: Eike Haß <eike-hass@web.de>
Co-authored-by: Oliver E. Anderson <oliver.anderson@iota.org>
Co-authored-by: cycraig <craig.bester@iota.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chore Tedious, typically non-functional change Documentation Improvements or additions to documentation. Excludes from changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants